package m3d28;

import java.io.FileNotFoundException;

public class mFinally {
    public static void main(String[] args) {
        try {
            readFilename("d/");   //alt+huiche
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }finally{
            //要和try一起用，不可单独
            //无论是否异常都会执行
            System.out.println("zhixl");
        }
    }

    public static void readFilename(String filename)throws FileNotFoundException {
        if(!filename.equals("c/")){
            throw new FileNotFoundException("路径不对");
        }
    }
}
